<?php
namespace Ionafan2\GetonlyimgBundle\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * Class ImageRepository
 * @package Ionafan2\GetonlyimgBundle\Repository
 */
class ImageRepository extends EntityRepository
{

    /**
     * @param $ids
     * @return array
     */
    public function getImagesLinksArray($ids) {

        $query = $this->createQueryBuilder('imgs');

        $select = $query
            ->select('i')
            ->from('Ionafan2GetonlyimgBundle:Image', 'i')
            ->where($query->expr()->in('i.id', explode(",",$ids)));

          return  $select->getQuery()->getResult();
    }
}
